package com.jbit.jboa.action;

import java.util.List;

import com.jbit.jboa.entity.Employee;
import com.jbit.jboa.service.impl.EmployeeService;
import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport{
	
	
	//EmployeeService
	private EmployeeService employeeservice;
	public void setEmployeeservice(EmployeeService employeeservice) {
		this.employeeservice = employeeservice;
	}




	//Employee
	private Employee employee;
	public Employee getEmployee() {
		return employee;
	}
	public void setEmployee(Employee employee) {
		this.employee = employee;
	}




	/**
	 * execute
	 */
	public String execute(){
		List<Employee> employeeList = employeeservice.findByExample(employee);
		if(employeeList.size()==1){
			return SUCCESS;	
		}else{
			return INPUT;
		}
		
	}



}
